package com.handle.system.svc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.handle.common.core.constants.Constant;
import com.handle.common.redis.generator.RedisIdGenerator;
import com.handle.system.api.entity.SysOperateLog;
import com.handle.system.api.service.ISysOperateLogService;
import com.handle.system.svc.mapper.SysOperateLogMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 操作日志 服务实现类
 * </p>
 *
 * @author zhangqing
 * @since 2021-07-17
 */
@Service
@AllArgsConstructor
public class SysOperateLogServiceImpl extends ServiceImpl<SysOperateLogMapper, SysOperateLog> implements ISysOperateLogService {

    private final RedisIdGenerator redisIdGenerator;

    @Override
    public void addLoginLog(SysOperateLog sysOperateLog) {
        sysOperateLog.setId(redisIdGenerator.nextId(Constant.SYS_OPERATE_LOG_KEY));
        this.baseMapper.insert(sysOperateLog);
    }
}
